<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			// 1:实现时间的动态显示功能，
			// 要求能显示星期几，年月日，小时分钟秒
			function time(){
				var d=new Date();
				var year = d.getFullYear(); //当前年份
				var month = d.getMonth(); //当前月份
				var data = d.getDate(); //天
				var h = d.getHours(); //小时
				var m = d.getMinutes(); //分
				var s = d.getSeconds(); //秒
				var days=new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六");
				var day=d.getDay();
				var td=days[day];
				document.getElementById("adv").innerHTML=year+"年"+month+"月"+data+"日"+"&nbsp;&nbsp;&nbsp;&nbsp;"+h+":"+m+":"+s+"&nbsp;&nbsp;&nbsp;&nbsp;"+td;
			}
			function showtime(){
				time();
				window.setInterval("time()");
			}		
		</script>
	</head>
	<body onload="showtime()">
		<div id="adv">
			
		</div>
	</body>
<ml>

